<%@ page import="com.pixiv.Entity.User" %>
<%@ page import="com.pixiv.MysqlDAO.UserLoginDAO" %>
<%@ page import="com.pixiv.Entity.TitlePicutre" %><%--
  Created by IntelliJ IDEA.
  User: hasee
  Date: 2021/11/25
  Time: 17:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel = "stylesheet" href = "${pageContext.request.contextPath}/common/layui/css/layui.css">
    <script src = "${pageContext.request.contextPath}/common/jquery3.6.0.js"></script>
    <script src = "${pageContext.request.contextPath}/common/layui/layui.js"></script>
    <%
        User u = (User) session.getAttribute("GLOBAL_USER_OBJECT");
        if (u != null && u.getUserID() < 0)
        {
            UserLoginDAO.initLoginUserData(u);
        }
        User selectUser = u;
        TitlePicutre tp = (TitlePicutre) u.getVar().get_vector("GLOBAL_TitleListVectorSave");

        int ageOrgin = tp.getAuditOrginal();
        int ageLimit = tp.getAuditAgeLimit();
        String date = tp.getAuditUploadTime();
    %>

</head>
<body>
<div id = "head_test_0">
    <div class="layui-main layui-container">
        <div class="layui-col-md4">
            <!--<img style = "float:left;border:1px solid black;" src = "" width = "39px" height = "39px">-->
            <i id = "pointToLeft" class="layui-icon" style="
            cursor:pointer;width:39px;height:39px;float:left;">&#xe857;</i>
            <img id = "gotoPosition" src = "../img/pixiv.png" width = "120px";height = "65px"  style="margin-left:-240px;margin-top:-10px;">
            <script type = "text/javascript">
                document.querySelector("#gotoPosition").onclick = function(){
                    location.href = "../index.jsp";
                }
            </script>

            <div style = "line-height:49px;float:left;"></div>

        </div>
        <div class="layui-col-md3">
            <input type = "text" id = "searchInfo">
        </div>
        <div class="layui-col-md5">

            <ul class="layui-nav" style = "background-color:ghostwhite;">
                <li class="layui-nav-item">
                    <input type = "button"  style = "width:125px;height:55px;
                       border:0px;border-radius:39px;margin-left:15px;" value = "投稿" id = "upPictureToTarget"><!--按钮-->
                </li>
                <li class="layui-nav-item">
                    <a href="">个人中心<span class="layui-badge-dot"></span></a>
                </li>
                <li class="layui-nav-item" lay-unselect="">
                    <img src="/pixiv/user/getUserIcon" id = "UserIconDisplay" class="layui-nav-img">
                    <dl class="layui-nav-child" style = "width:150px;margin-left:-40px;margin-top:-16px;">

                        <img src = "/pixiv/user/getUserIcon"
                             style = "width:75px;height:75px;border-radius:35px;border:0px;">
                        <dd style = "color:rgba(20,20,20,0.7);">账号id:<%out.write(String.valueOf(u.getUserID()));%></dd>
                        <dd style = "color:rgba(20,20,20,0.7);">用户姓名:<%out.write(u.getName() );%></dd>
                        <dd style = "color:rgba(20,20,20,0.7);">e-mail:<%out.write(u.getEMail() );%></dd>
                        <dd style = "color:rgba(20,20,20,0.7);"><a href="../set/setuser.jsp">设置</a></dd>
                        <dd style = "color:rgba(20,20,20,0.7);"><a href="../titleshow/showmytitlepicture.jsp">查看我的图库</a></dd>
                        <dd style = "color:rgba(20,20,20,0.7);"><a href="../login.jsp">退出登录</a></dd>
                    </dl>
                </li>
            </ul>


        </div>
    </div>
    <style type = "text/css">
        /*用户头像控件调整*/
        #UserIconDisplay{
            width:39px;
            height:39px;
            background-color:blanchedalmond;
            border-radius:39px;
            cursor:pointer;

        }
        /*查找信息*/
        #searchInfo{
            margin-left:100px;
            margin-right:100px;
            width:40%;
            height:39px;
            float:left;
            border:0px;
        }
    </style>

</div>

<div style = "margin-top:0px;margin-left:10px;width:285px;height:900px;position:fixed;
    left:1065px;top:80px;z-index:20;background-color:rgba(143,147,204,0.1);" id = "rightUser">
    <img id = "userIconBig"
         src = "/pixiv/PixivUserIconServlet?appType=getUserIcon"
         style = "margin-top:20px;margin-left:20px;border-radius:25px;width:50px;height:50px;float:left;">

    <h2 style = "margin-top:31px;margin-left:5px;"><%out.write(u.getName() );%></h2>
    <br>
    <input type = "button" value = "查看用户其他信息" style =
            "margin-left:15px;margin-top:20px;width:100px;height:30px;border-radius:15px;border:0px;
            background-color:rgba(143,147,204,1.0);color:rgba(255,255,255,1.0);font-size:12px;">

    <div style="width:279px;height:1px;border-top:1px solid rgba(0,0,0,0.15);margin-top:10px;"></div>

    <div style = "margin-left:5px;width:279px;height:600px;">
        <h3 style = "text-align:center;width:279px;"><%=tp.getAuditTitleCaption()%></h3><br>
        <h4 style = "text-align:left;width:279px;"><%=tp.getAuditTitleContext()%></h4>

        <div style="width:279px;height:1px;border-top:1px solid rgba(0,0,0,0.15);margin-top:50px;"></div>
        <h4 style = "text-align:left;width:279px;margin-top:0px"><%out.write((ageOrgin == 1?"个人原创":"搬运"));%></h4>
        <h4 style = "text-align:left;width:279px;margin-top:0px"><%out.write((ageLimit == 1?"全年龄":ageLimit == 2?"不低于18岁":"不低于12岁"));%></h4>
        <h4 style = "text-align:left;width:279px;margin-top:0px">上传日期:<%=date%></h4>
    </div>

    <script type = "text/javascript">
        var right = document.querySelector("#rightUser");
        window.onscroll = function()
        {
            let y = window.pageYOffset;
            if (y < 100)
            {
                right.style.top = (100 - y) + "px";
            }else{
                right.style.top =  "0px";
            }

        }

        function getAccel(val1,val2,val3,val4)
        {
            let flat = val1 / val2;
            return val3 + parseInt(flat * (val4 - val3));
        }
    </script>

</div>

<div id = "head_test_1">
    <div class = "layui-main layui-container" style = "width:1200px;height:900px;">

        <div style = "width:900px;float:left;height:900px;background-color:rgba(255,255,255,1.0);" id = "showPicture">
            <%
                String uuid = tp.getAuditTitleUUID();
                int count = tp.getAuditTitlePictureCount();

                for (int i = 0;i<count;i++) {

                    String path = "/pixiv/MVCshowMyTitlePicture/getP?location=" + (i + 1);
                    out.write("<img src = \"" + path + "\" uuid = \"" + uuid + "\">");
                }
                //System.out.println("图片数量:" + count);
            %>

        </div>

        <div style = "margin-top:0px;margin-left:10px;float:left;width:180px;height:900px;">
        </div>

    </div>

    <style type = "text/css">
        #head_test_1{
            width:100%;
            height:900px;
            position:absolute;
            left:0px;
            top:80px;
        }
        #showPicture>img{
            width:700px;
            size:700px;
            margin-left:100px;
            margin-top:10px;

        }

        #coverShow:hover{
            background-color:rgba(0,0,0,0.05);
        }
    </style>
</div>

<div id = "head_test_2">
</div>
</body>
</html>
